<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>食谱管理</title>
    <link href="layui/css/layui.css" rel="stylesheet">
</head>
<body>
<h1 style="text-align: center;color:#1e9fff;">食谱</h1>
<table class="layui-hide" id="recipe" lay-filter="recipe">


</table>

<table class="table table-hover ">
    <thead>
    <tr>
        <th>ID</th>
        <th>用户名</th>
        <th>密码</th>
        <th>姓名</th>
        <th>性别</th>
        <th>联系电话</th>
        <th>操作</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${list}" var="recipe">

        <tr>
            <td>${recipe.recipe_id}</td>
            <td>${recipe.recipe_name}</td>
            <td>${recipe.category}</td>
            <td>${recipe.image}</td>
            <td>${recipe.unit}</td>
            <td>${recipe.unit_price}</td>
            <td>${recipe.cooking_instructions}</td>
            <td>${recipe.is_active}</td>
            <td>
                </div>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>


<script src="layui/layui.js"></script>
<script>
    layui.use(function () {
        let table = layui.table;
        table.render({
            elem: "#recipe",
            url: "",
            page: true,
            request: {
                pageName: 'pageNo', // 页码的参数名称，默认：page
                limitName: 'pageSize' // 每页数据条数的参数名，默认：limit
            },
            cols: [[
                {
                    title: "菜品编号",
                    field: "recipe_id"
                },
                {
                    title: "菜品名",
                    field: "recipe_name"
                },
                {
                    title: "菜品系列",
                    field: "category"
                },
                {
                    title: "图片",
                    field: "image"
                },
                {
                    title: "单位",
                    field: "unit"
                },
                {
                    title: "单价",
                    field: "unit_price"
                },
                {
                    title: "烹饪过程",
                    field: "cooking_instructions"
                },
                {
                    title: "是否上架",
                    field: "is_active"
                }
            ]]
        });
    });

</script>
</body>
</html>
